/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package chameleon.view.input;

import chameleon.model.AbstractManager;
import java.util.Hashtable;

/**
 * This class is an implementation of pattern decorator. The decoration are :
 *  -Smv File
 *
 * An input instance is created by the inputFactory.
 * Only one instance of each decorator can be added to the object.
 */

/**
 *
 * @author Simon De Baets
 */
public class Input {

    private Hashtable decorations_;
    private int tool_;//Which tool is use
    private AbstractManager manager_;//manager for corresponding tool





    //**************************** CONSTRUCTOR *****************************//
    public Input(){
        decorations_ = new Hashtable();
    }

    public Input(int tool){
        decorations_ = new Hashtable();
        tool_ = tool;
    }


    //**************************** QUESTION METHODS ************************//
    public boolean hasSmvFile(){return getSmvFile()!=null;}

    //**************************** GETTER *********************************//

    public Input getInput() {
        return this;
    }

    public InputDecorator getSmvFile(){
       return (InputDecorator) decorations_.get(Tag.NUSMV);
    }
    
    public int getToolName(){
        return tool_;
    }

    public AbstractManager getManager(){
        return manager_;
    }

    //*************************** SETTER *********************************//

    public void setToolName(int toolName){
        tool_ = toolName;
    }
    
    public void setManager(AbstractManager manager){
        manager_ = manager;
    }
    //*************************** METHOD ********************************//
    
    public void addDecoration (InputDecorator decoration){
        decorations_.put(decoration.getTag(),decoration);
    }

    public void deleteAllDecoration(){
        decorations_=new Hashtable();
    }

}
